App({
  userId: null,
  auth_url: 'http://younika.cn/api/ali/auth', //获取用户授权
  findOrders_url: 'http://younika.cn/api/mot/find',  //用户id对应的所有订单
  queryOrderDetail_url: 'http://younika.cn/api/mot/find_info', //订单详情
  orderSubmit_url: 'http://younika.cn/api/mot/order',  //订单信息提交
  validateCode_url: 'http://younika.cn/api/sms/send',  //获取验证码
  getUserInfo() {
    my.getAuthCode({
      scopes: 'auth_base',
      success: (res) => {
        console.log(res)
        my.httpRequest({
          url: this.auth_url,
          data: {
            code: res.authCode
          },
          method: 'GET',
          success: (res) => {
            console.log(res)
            this.userId=res.data.data.uid;
          },
          fail: function(res) {
            console.log({content: '用户授权失败'});
          },
        });
      },
    });
    
    
  },
  onLaunch(options) {
    my.showLoading({
      content: '加载中...',
      delay: 500,
    });
    setTimeout(() => {
      my.hideLoading();
    }, 2000);
  }
  
  
});
